package com.wangyonghui.service.user.config;

import lombok.Data;

@Data
public class ResultEntity {
    private String reason;
    private Integer code;
    private Object result;

    public ResultEntity() {

    }

    public ResultEntity(String reason, Integer code, Object result) {
        this.reason = reason;
        this.code = code;
        this.result = result;
    }

    public static ResultEntity ok(Object result) {
        return new ResultEntity("", 1000, result);
    }

    public static ResultEntity err() {
        return new ResultEntity("", 1001, null);
    }

    public static ResultEntity error(boolean b) {
        return new ResultEntity("操作失败", 1001, null);
    }
}